package com.xinz.command.admin.player;

import java.util.HashMap;
import java.util.Map;

import com.google.gson.Gson;
import com.xinz.command.BaseCmd;
import com.xinz.model.Player;

/**
 * 查看玩家信息
 * @author 鹩哥
 *
 */
public class ViewPlayerCmd extends BaseCmd{

	@Override
	protected String done(Player player, String[] args) throws Exception {
		Map<String, Object> data = new HashMap<String, Object>();
		try {
			data.put("id", player.getId());
			data.put("name", player.getName());
			data.put("isBoy", player.isBoy());
			data.put("money", player.getMoney());
			data.put("gold", player.getGold());
			data.put("score", player.getGold());
			data.put("banAccountTime", player.getBanAccountTime());
			data.put("winTimes", player.getWinTimes());
			data.put("loseTimes", player.getLoseTimes());
			data.put("drawTimes", player.getDrawTimes());
			data.put("fleeTimes", player.getFleeTimes());
		}
		catch(Exception e) {
			data.put(TAG_RESULT, e.getMessage());
		}
		return new Gson().toJson(data);
	}

}
